xend: allow domain creation with multiple empty CD-ROM devices
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 30 Sep 2009 07:51:21 +0000 (08:51 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 30 Sep 2009 07:51:21 +0000 (08:51 +0100)
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
tools/python/xen/xend/XendConfig.py

index 9c84c26c6532467a132aeb45180c5734f83aa7a0..ac5f66c675416482e18fe5da560e0430381c242e 100644 (file)
@@ -1202,14 +1202,14 @@ class XendConfig(dict):
                 if o_dev_type == 'vbd' or o_dev_type == 'tap' or o_dev_type == 'tap2':
                     blkdev_file = blkdev_uname_to_file(dev_uname)
                     o_dev_uname = sxp.child_value(o_dev_info, 'uname')
-                    if o_dev_uname != None:
+                    if o_dev_uname and o_dev_uname != None:
                         o_blkdev_file = blkdev_uname_to_file(o_dev_uname)
                         if blkdev_file == o_blkdev_file:
                             raise XendConfigError('The file "%s" is already used' %
                                                   blkdev_file)
-                    if dev_uname == o_dev_uname:
-                        raise XendConfigError('The uname "%s" is already defined' %
-                                             dev_uname)
+                        if dev_uname and dev_uname == o_dev_uname:
+                            raise XendConfigError('The uname "%s" is already defined' %
+                                                  dev_uname)
                     o_blkdev_name = sxp.child_value(o_dev_info, 'dev')
                     o_devid = self._blkdev_name_to_number(o_blkdev_name)
                     if o_devid != None and devid == o_devid: